#ifndef SORTFILTERPROXYMODEL_H
#define SORTFILTERPROXYMODEL_H

#include <QSortFilterProxyModel>


class SortFilterProxyModel : public QSortFilterProxyModel
{
    Q_OBJECT
public:
    explicit SortFilterProxyModel (QObject *parent = 0);

    bool isSortNumerical() const;
    bool isSortNumerical (int column) const;
    int sortRole() const;
    int sortRole (int column) const;
    QVariant data (const QModelIndex &index, int role) const;
    QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;

public slots:
    void setSortNumerical (bool enable);
    void setSortNumerical (bool enable, int column);
    void setSortRole (int role);
    void setSortRole (int role, int column);
    void clearColumnSortRoles();

protected:
    bool lessThan (const QModelIndex& left, const QModelIndex& right) const;

    QHash<int,int> m_sortRoleHash;
    QHash<int,bool> m_sortNumericalHash;
    bool m_sortNumerical;
};


#endif // SORTFILTERPROXYMODEL_H
